package com.ruoyi.web.controller.vis;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.SysNotice;
import com.ruoyi.system.vis.domain.VisDeptList;
import com.ruoyi.system.vis.service.VisDeptListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/his/reg")
public class VisDeptListController extends BaseController {
    @Autowired
    private VisDeptListService visDeptListService;

    @GetMapping("/all")
    public List<VisDeptList> list()
    {
        List<VisDeptList> list = visDeptListService.selectAll();
        return list;
    }

    @PostMapping("/dept")
    public AjaxResult getInfo(@RequestBody String deptId) {
        System.out.println(deptId);
        long l = Long.parseLong(deptId);
        return success(visDeptListService.selectDeptListByName(l));
    }
}
